package com.honey.mybatis.generator.model.method;

import com.honey.compilation.java.AbstractJavaCompilation;
import com.honey.compilation.java.JavaKeyWord;
import com.honey.core.dbmapping.introspect.IntrospectSchema;
import com.honey.core.dbmapping.introspect.IntrospectSchemaColumn;
import com.honey.core.types.FullyQualifiedJavaType;
import com.honey.core.types.JDKFullyQualifiedJavaType;
import com.honey.mybatis.generator.AbstractMethod;
import com.honey.mybatis.generator.MybatisPlugin;
import com.honey.mybatis.generator.model.ModelConstant;

public class EnumToStringMethod  extends AbstractMethod {

	private static final String METHOD_NAME="toString" ;
	
	private static final String[] ANNOTATION = new String[]{
		"Override" ,
	};

	private static final FullyQualifiedJavaType  RETURN_TYPE = JDKFullyQualifiedJavaType.getStringInstance(); 
	
	private static final String[] BODY = new String[]{
		JavaKeyWord.RETURN.toString() + JavaKeyWord.OPERATION_THIS.toString() + ModelConstant.FIELD_VALUE,
	};
	
	
	public EnumToStringMethod(AbstractJavaCompilation clazz, MybatisPlugin belongPlugin,
			IntrospectSchema introspectSchema,
			IntrospectSchemaColumn introspectSchemaColumn) {
		super(clazz, belongPlugin, introspectSchema, introspectSchemaColumn);
		
	}
	
	@Override
	protected String getMethodName() {
		return METHOD_NAME;
	}

	/* (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getBody()
	 */
	@Override
	protected String[] getBody() {
		return BODY;
	}

	/* (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getAnnotation()
	 */
	@Override
	protected String[] getAnnotation() {
		return ANNOTATION;
	}

	@Override
	protected FullyQualifiedJavaType getReturnType() {
		return RETURN_TYPE;
	}

	
	
}
